package com.hsbc.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;


/**
 * 
 * @Description:   管理员
 * @author         weihu
 * @version        V1.0 
 * @Date           2018年12月25日 下午4:52:44
 */
@Entity
@Table(name="bc_admin")
public class Admin implements Serializable{

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
	private int id;
	
	//姓名
	private String realname;
	
	//密码
	private String password;
	
	//盐值
	private String salt;
	
	//状态（1：正常，0：冻结）
	private short state;
	
	//用户名
	private String username;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getRealname() {
		return realname;
	}

	public void setRealname(String realname) {
		this.realname = realname;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getSalt() {
		return salt;
	}

	public void setSalt(String salt) {
		this.salt = salt;
	}

	public short getState() {
		return state;
	}

	public void setState(short state) {
		this.state = state;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}
	
	/**
	 * 
	 * @Description:  获取盐值（用户名+盐值）
	 * @return:       String  盐值 
	 * @author        weihu
	 * @Date          2018年12月25日 下午5:42:49
	 */
	public String getCredentialsSalt() {
        return this.username + this.salt;
    }
}
